.mod-deploy.create-deploy2(ng-form role="form" name="deployForm" ng-class="{'need-valid':needValid}" novalidate)
    loading(ng-if="loadingsIns.isLoading||deployIns.loadingIns.isLoading")
    ul.com-list-info
        li.has-border
            span.info-name 实例个数
            .info-content.container-info
                .line-short
                    input.ui-input-fill.ui-input-sm.container-txt(ng-model="config.replicas" name="replicas" ng-pattern="/^[1-9]\\d*$/" is-over max="999" min="1")
                    span.container-unit 个
                span.txt-error(ng-if="(needValid||deployForm.replicas.$dirty)&&deployForm.replicas.$invalid") 请填写0~999范围内的数字
        li.has-border
            span.info-name 筛选主机
            .info-content
                .line-short
                    .com-select-con.line-element(select-con)
                        button.ui-btn.ui-btn-white.ui-btn-select
                            i.icon-down
                            | {{deployIns.clusterListIns.cluster.name||'选择集群'}}
                        ul.select-list
                            li(ng-if="deployIns.clusterListIns.clusterList.length===0")
                                a 无相关信息
                            li.select-item(ng-repeat="cluster in deployIns.clusterListIns.clusterList")
                                a(ng-click="deployIns.toggleCluster($index)" ng-bind="cluster.name")
                        input(type="hidden" ng-model="deployIns.clusterListIns.cluster.name" name="clusterName" required)
                        span.txt-error(ng-if="(needValid||validHost)&&deployForm.clusterName.$invalid") 请选择集群
                    .com-select-con.line-element.tool-next(select-con)
                        button.ui-btn.ui-btn-white.ui-btn-select.line-element(ng-cloak)
                            i.icon-down
                            | {{deployIns.envText}}
                        ul.select-list
                            li.select-item(ng-repeat="env in deployIns.envList")
                                a(ng-bind="env.text" ng-click="deployIns.toggleEnv(env)")
                        input(type="hidden" ng-model="config.hostEnv" name="hostEnv" required)
                        span.txt-error(ng-if="(needValid||validHost)&&deployForm.hostEnv.$invalid") 请选择部署环境
                .line-long.top-margin
                    .ui-input-white.host-txt-con.com-select-con(select-con label="true")
                        ul.selected-labels
                            li.select-label(ng-repeat="(label,value) in deployIns.nodeListIns.labelsInfo|search:'isSelected':true|search:'isShow':true" ng-cloak)
                                | {{label}}
                                a.icon-cancel(ng-click="deployIns.nodeListIns.toggleLabel(label,false)")
                            li.select-input
                                input.line-element.ui-btn-select(placeholder="选择主机标签" ng-model="labelKey.key" ng-keydown="labelKeyDown($event,labelKey.key,labelsInfoFiltered);" ng-focus="selectFocus()")
                        ul.select-list
                            li(ng-if="vmDome.objLength(labelsInfoFiltered)===0")
                                a 无相关信息
                            li.select-item(ng-repeat="(label,value) in labelsInfoFiltered=(deployIns.nodeListIns.labelsInfo| searchKey:labelKey.key|search:'isShow':true)")
                                a(ng-bind="label" ng-click="deployIns.nodeListIns.toggleLabel(label,true);labelKey.key='';")
                    span.txt-wrap
                        a.link-safe(ng-click="deployIns.nodeListIns.showHost()") 查看选中主机
        li
            span.info-name namespace
            .info-content
                .line-short(ng-if="!deployIns.isNewNamespace")
                    .line-element.com-select-con(select-con)
                        button.ui-btn.ui-btn-white.ui-btn-select
                            i.icon-down
                            | {{config.namespace||'选择已有namespace'}}
                        ul.select-list
                            li(ng-if="deployIns.namespaceList.length===0")
                                a 无相关信息
                            li.select-item(ng-repeat="namespace in deployIns.namespaceList")
                                a(ng-bind="namespace.name" ng-click="deployIns.toggleNamespace(namespace.name)")
                    span.txt-wrap
                        a.link-safe(ng-click="deployIns.toggleIsNewNamespace()") 新建namespace
                    input(type="hidden" name="selectNamespace" ng-model="config.namespace" required)
                .line-short(ng-if="deployIns.isNewNamespace")
                    input.ui-input-white.line-element(placeholder="新建namespace" ng-model="config.namespace" name="namespace" ng-model-options="{updateOn:'default blur',debounce:{default:500,blur:0}}" required ng-pattern="/^[a-zA-Z][a-zA-Z0-9_-]*$/" is-namespace-exist clusterid="{{deployIns.clusterListIns.cluster.id}}")
                    span.txt-wrap
                        a.link-safe(ng-click="deployIns.toggleIsNewNamespace()") 选择已有namespace
                span.txt-error(ng-if="needValid&&deployForm.selectNamespace.$invalid") 请选择namespace
                span.txt-error(ng-if="(needValid||deployForm.namespace.$dirty)&&deployForm.namespace.$error.required") 请填写namespace
                span.txt-error(ng-if="(needValid||deployForm.namespace.$dirty)&&!deployForm.namespace.$error.required&&deployForm.namespace.$error.pattern") 非法的namespace
                span.txt-error(ng-if="(needValid||deployForm.namespace.$dirty)&&!deployForm.namespace.$error.required&&deployForm.namespace.$error.isNamespaceExist") namespace已存在
        li
            span.info-name 部署名称
            .info-content
                .line-long
                    input.ui-input-fill.line-element(ng-model="config.deployName" name="deployName" required is-deploy-exist namespace="{{config.namespace}}" ng-maxlength="20" clustername="{{deployIns.clusterListIns.cluster.name}}" ng-pattern="/^[0-9a-z](-*[0-9a-z]+)*$/" ng-model-options="{updateOn:'default blur',debounce:{default:500,blur:0}}" )
                .txt-error(ng-if="(needValid||deployForm.deployName.$dirty)&&deployForm.deployName.$error.required") 必填
                .txt-error(ng-if="(needValid||deployForm.deployName.$dirty)&&!deployForm.deployName.$error.required&&deployForm.deployName.$error.isDeployExist") 部署名已存在
                .txt-error(ng-if="(needValid||deployForm.deployName.$dirty)&&!deployForm.deployName.$error.required&&deployForm.deployName.$error.pattern") 非法的名称
                span.txt-error(ng-if="(needValid||deployForm.deployName.$dirty)&&!deployForm.deployName.$error.required&&deployForm.deployName.$error.maxlength") 长度超出限制
        li.has-border
            span.info-name 创建者
            .info-content
                creator-selection(change-event="deployIns.toggleCreator(user)" default-user-id="deployIns.creator.id" default-user-type="{{deployIns.creator.type}}")
                input(type="hidden" name="creatorName" ng-model="deployIns.creator.id" required)
                span.txt-error(ng-show="needValid&&deployForm.creatorName.$invalid") 请选择创建者
        li.has-border
            span.info-name 日志
            .info-content
                p.txt-prompt.no-log(ng-if="deployIns.logConfig===0") 所选集群没有开启日志自动收集。不能进行日志相关配置。
                button.ui-btn.ui-btn-sm.ui-btn-active.add-log(ng-click="deployIns.addLogDraft()" ng-if="deployIns.logConfig") 添加
                div.log-item(ng-form ng-repeat="log in config.logDraft.logItemDrafts" name="childForm" ng-if="deployIns.logConfig")
                    a.icon-cancel.cancel-log(ng-click="deployIns.deleteLogDraft($index)")
                    input.ui-input-fill.element-full(placeholder="请输入日志路径，不能放在根目录下" ng-pattern="/^\/.*[^\/]$/" ng-model="log.logPath" name="logPath" is-required param1="{{log.autoCollect&&log.logTopic}}" param2="{{log.autoCollect&&log.processCmd}}" param3="{{log.autoDelete&&log.logExpired}}")
                    span.txt-error(ng-if="(needValid||childForm.logPath.$dirty)&&childForm.logPath.$error.pattern") 非法的格式
                    div.log-check
                        input.ui-check(id="autoCollect{{$index}}" type="checkbox" name="autoCollect" ng-model="log.autoCollect")
                        label(for="autoCollect{{$index}}") 自动收集日志
                    .line-full(ng-if="log.autoCollect")
                        span.log-title  日志topic
                        input.ui-input-fill.line-element(placeholder="请输入日志topic" name="logTopic" ng-model="log.logTopic" required)
                    .line-full(ng-if="log.autoCollect")
                        span.log-title  预处理命令
                        .line-element
                            input.ui-input-fill.full(placeholder="请输入预处理命令" name="processCmd" ng-model="log.processCmd")
                            span.txt-wrap
                                a.icon-help(popover="对收集到的日志做进一步处理，比如筛选或增减字段等，可以用grep和awk命令完成，命令以管道形式执行，因此必须以“|”开始，比如一个典型的处理命令为：   | grep \"ERROR\\\\|WARN\\\\| EXCEPTION\\\\| statistic\" | awk -vnhost=\"$HOSTNAME\" '{print \"[\"nhost\"]--\"$0}'，该命令将只筛选包含四个对应关键字的行，并且会在行首添加\"[hostname]--\"的字符串，参照可完成其他复杂的处理方式")
                    div.log-check
                        input.ui-check(id="autoDelete{{$index}}" type="checkbox" name="autoDelete" ng-model="log.autoDelete")
                        label(for="autoDelete{{$index}}") 自动删除日志
                    .line-full(ng-if="log.autoDelete")
                        span.log-title  过期时间
                        input.ui-input-fill(placeholder="过期则自动删除" name="logExpired" ng-model="log.logExpired" required ng-pattern="/^[1-9]\\d*$/" )
                        span.unit 小时
                    .txt-error.log-error(ng-if="(needValid||deployForm.logExpired.$dirty)&&deployForm.logExpired.$invalid") 请输入大于0的整数
        li.has-border
            span.info-name 网络模式
            .info-content
                span.com-check-con(ng-click="deployIns.visitMode='noAccess'")
                    input#checkOverlay.ui-radio(type="radio" value="DEFAULT" name="netWork" ng-model="config.networkMode" )
                    label(for="checkOverlay") Overlay
                span.com-check-con(ng-click="deployIns.visitMode='noAccess';config.healthCheckerDraft.type='NONE'")
                    input#checkHost.ui-radio(type="radio" value="HOST" name="netWork" ng-model="config.networkMode"  ng-change="deployIns.validIps();")
                    label(for="checkHost") Host
                p.txt-prompt(ng-if="config.networkMode=='HOST'") Host网络模式下不能使用健康检查
        li.has-border
            span.info-name 访问设置
            .info-content
                span.com-check-con
                    input#noAccess.ui-radio(type="radio" value="noAccess" name="visitMode" ng-model="deployIns.visitMode" ng-change="deployIns.validIps();")
                    label(for="noAccess") 禁止访问
                span.com-check-con(ng-if="config.networkMode=='HOST'")
                    input#access.ui-radio(type="radio" value="access" name="visitMode" ng-model="deployIns.visitMode" ng-change="deployIns.validIps();")
                    label(for="access") 允许访问
                span.com-check-con(ng-if="config.networkMode=='DEFAULT'")
                    input#internal.ui-radio(type="radio" value="internal" name="visitMode" ng-model="deployIns.visitMode" ng-change="deployIns.validIps();")
                    label(for="internal") 对内服务
                span.com-check-con(ng-if="config.networkMode=='DEFAULT'")
                    input#foreign.ui-radio(type="radio" value="foreign" name="visitMode" ng-model="deployIns.visitMode" ng-change="deployIns.validIps();")
                    label(for="foreign") 对外服务
        li.has-border(ng-if="deployIns.visitMode!='noAccess'")
            span.info-name
            .info-content
                div.log-item(ng-form  name="childForm" ng-if="config.networkMode=='DEFAULT'")
                    div(ng-if="deployIns.visitMode=='foreign'" ng-repeat="loadbalance in config.loadBalanceDrafts")
                        .line-full
                            span.log-title  程序服务端口
                            input.ui-input-fill.line-element(placeholder="请输入容器内部端口" name="targetPort" ng-model="loadbalance.targetPort" is-required param1="loadbalance.port")
                        .line-full
                            span.log-title  对外访问端口
                            input.ui-input-fill.line-element(placeholder="请输入端口号" name="port" ng-model="loadbalance.port"  is-required param1="loadbalance.targetPort")
                        .line-full
                            span.log-title  对外访问IP
                            .line-element
                                select-input.select-input-wrap(d-placeholder="搜索ip" option-list="deployIns.nodeListForIps" show-key="ip" d-click="deployIns.validIps()")
                                    | {{item.ip}}
                                    span.item-right.txt-prompt(ng-bind="'主机：'+item.name")
                                span.txt-error(ng-if="needValid&&!deployIns.valid.ips") 至少选择一个IP
                    div(ng-if="deployIns.visitMode=='internal'" ng-repeat="innerService in config.innerServiceDrafts")
                        .line-full
                            span.log-title  程序服务端口
                            input.ui-input-fill.line-element(placeholder="请输入容器内部端口" name="targetPort" ng-model="innerService.port" required)
                        span.txt-prompt.tool-align-input
                            | 集群内部访问端口和程序服务端口相同
                div.log-item(ng-form name="openHostForm" ng-if="config.networkMode=='HOST'")
                    .line-full
                        span.serlog-title 对外暴露端口个数:
                        input.ui-input-fill.line-element(name="hostNum" ng-model="config.exposePortNum" required ng-pattern="/^[1-9]\\d*$/")
                    span.txt-prompt.tool-align-input Host网络下，系统会给每个实例分配若干个端口，用于对外服务和实例间通信。此外，在Host网络下，实例ip和宿主机ip一致。
    .com-bottom-option
        span.com-bottom-option-con
            button.ui-btn.ui-btn-md.ui-btn-bright(ng-disabled="loadingsIns.isLoading||deployIns.loadingIns.isLoading" ng-click="toLastStep()") 上一步
            button.ui-btn.ui-btn-md.ui-btn-bright(ng-disabled="loadingsIns.isLoading||deployIns.loadingIns.isLoading" ng-click="needValid=true;deployIns.validIps();deployForm.$valid&&deployIns.valid.ips&&toCreate()") 完成创建
            span.txt-error(ng-if="needValid&&(!deployIns.valid.ips||deployForm.$invalid)") 存在不合法数据，请修改后提交！
